<?php
    session_start();
    if(isset($_POST["email"])){
//        header('Location: ' . $_SERVER['PHP_SELF']);
        header('Location: /index-dev.php');
    }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />		
<?php
	if(stristr($_SERVER['HTTP_USER_AGENT'], '(iPad;') || stristr($_SERVER['HTTP_USER_AGENT'], 'iPhone OS')) {
		echo '<meta name="apple-mobile-web-app-capable" content="yes" />';
	}
	
	require_once 'include/Mobile_Detect.php';
	$detect = new Mobile_Detect;
	$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
	//$deviceType = (true || $detect->isMobile() ? 'mobile' : 'computer');
?>
        <title>Biblia</title>
        <meta name="author" content="Matei Nicolae" />
        <meta name="description" content="Aplicaţie pentru studiul Bibliei traducerea Dumitru Cornilescu cu trimiteri (studiu inductiv)" />
        <meta name="keywords" content="Biblia, Studiu, Dumitru Cornilescu, biblia cu trimiteri" />
        <link type="image/ico" href="favicon.ico" rel="shortcut icon"/>

        <!-- ext css includes -->
        <link rel="stylesheet" type="text/css" href="js/ext-3.4.1/resources/css/ext-all.css" />
        <!--link rel="stylesheet" type="text/css" href="js/ext-3.4.1/resources/css/ext-all-bible.css" /-->
<!--        <link rel="stylesheet" type="text/css" title="blue"      href="js/ext/resources/css/xtheme-blue-bible.css" />-->
<!--        <link rel="stylesheet" type="text/css" title="gray"      href="js/ext/resources/css/xtheme-gray-bible.css" />-->
        <link rel="stylesheet" type="text/css" href="js/ext-3.4.1/examples/ux/css/ux-all-bible.css" />

        <link rel="stylesheet" type="text/css" href="css/bible.css" />

        <!-- ext javascript includes -->
        <script type="text/javascript" src="js/ext-3.4.1/adapter/ext/ext-base-debug.js"></script>
        <script type="text/javascript" src="js/ext-3.4.1/ext-all-debug.js"></script>
		<script type="text/javascript" src="js/ext-3.4.1/examples/ux/ux-all-bible.js"></script>

        <script type="text/javascript" src="src/js/ux/ColorField/ColorField.js"></script>
        <script type="text/javascript" src="src/js/ux/StateProvider/StateProvider.js"></script>

        <!-- extensions -->
<!--	    <script type="text/javascript" src="js/ext/examples/themes/styleswitcher.js"></script>-->

        <script type="text/javascript" src="js/ext-3.4.1/src/locale/ext-lang-ro.js"></script>

        <script type="text/javascript">
			var deviceType = '<?php echo $deviceType; ?>';
		
            <?php if(isset($_SESSION['user_id'])) {
                require_once ("include/function.php");
            ?>
            var BibleLoggedUser = {
                    id: <?php echo $_SESSION['user_id']; ?>,
                    email: '<?php echo $_SESSION['user_email']; ?>'
                },
                BibleRecordsKeywords = <?php echo getKeywords(); ?>;
        <?php } else { ?>
            var BibleLoggedUser = false,
                BibleRecordsKeywords = [];
        <?php } ?>
        </script>

        <script type="text/javascript" src="src/js/locale/ro.js"></script>

        <script type="text/javascript" src="src/js/Bible.js"></script>
        <script type="text/javascript" src="src/js/ext-fixes/js/fixes.js"></script>
        <script type="text/javascript" src="src/js/util/Format.js"></script>
        <script type="text/javascript" src="src/js/util/Terminology.js"></script>
        <script type="text/javascript" src="src/js/util/EventManager.js"></script>
        <script type="text/javascript" src="src/js/data/BibleBooksArrayStore.js"></script>
        <script type="text/javascript" src="src/js/data/BibleSearchStore.js"></script>
        <script type="text/javascript" src="src/js/widgets/plugins/CrudPlugin.js"></script>
        <script type="text/javascript" src="src/js/widgets/plugins/TabPanelAddButton.js"></script>
        <script type="text/javascript" src="src/js/widgets/NavigationToolbar.js"></script>
        <script type="text/javascript" src="src/js/form/SearchFieldLocal.js"></script>
        <script type="text/javascript" src="src/js/form/BibleBooksComboBox.js"></script>
        <script type="text/javascript" src="src/js/grid/BibleGridPanel.js"></script>
        <script type="text/javascript" src="src/js/grid/KeywordsEditorGridPanel.js"></script>
        <script type="text/javascript" src="src/js/grid/SearchGridPanel.js"></script>
        <script type="text/javascript" src="src/js/grid/BookThemesGridPanel.js"></script>
        <script type="text/javascript" src="src/js/widgets/ReadContainer.js"></script>
        <script type="text/javascript" src="src/js/BibleApplication.js"></script>
    </head>

<body class="<?php echo $deviceType; ?>-device">

<div class="x-hide-display">
    <form method="POST" action="" id="login_form" >
        <input autocomplete="on" id="input_username" name="email" type="text" />
        <input autocomplete="on" id="input_password" name="password" type="password" />
    </form>
</div>

</body>
</html>